Connection sidebar shows db icon based on type
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
src/images/mysql-logo-32.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 861 B |
@ -247,12 +247,17 @@ class Main extends GtkWindow {
|
|||||||
{
|
{
|
||||||
$info = $model->get_value($iter, 0);
|
$info = $model->get_value($iter, 0);
|
||||||
$db_type = strtolower($info->type);
|
$db_type = strtolower($info->type);
|
||||||
$img_file = BASE_DIR."/images/{$type}-logo-32.png";
|
$img_file = BASE_DIR."/images/{$db_type}-logo-32.png";
|
||||||
|
|
||||||
if(is_file($img_file))
|
if(is_file($img_file))
|
||||||
{
|
{
|
||||||
$cell->set_property('pixbuf', GdkPixbuf::new_from_file($img_file));
|
$cell->set_property('pixbuf', GdkPixbuf::new_from_file($img_file));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$img = new GtkImage();
|
||||||
|
$cell->set_property('pixbuf', $img->get_pixbuf());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -265,7 +270,7 @@ class Main extends GtkWindow {
|
|||||||
*/
|
*/
|
||||||
public function set_label($col, $cell, $model, $iter)
|
public function set_label($col, $cell, $model, $iter)
|
||||||
{
|
{
|
||||||
$info = $model->get_value($iter, 1);
|
$info = $model->get_value($iter, 0);
|
||||||
$cell->set_property('text', $info->name);
|
$cell->set_property('text', $info->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|