function __construct($toba_instalador)
 {
     $this->toba_instalador = $toba_instalador;
     $archivo = dirname(__FILE__) . '/toba.glade';
     $glade = new GladeXML($archivo, 'dlg_crear_instancia');
     foreach (self::$comp_req as $comp) {
         $this->comp[$comp] = $glade->get_widget($comp);
     }
     $glade->signal_autoconnect_instance($this);
     //---Bases disponibles
     $store = new GtkListStore(Gtk::TYPE_STRING);
     $instalacion = $this->toba_instalador->get_instalacion();
     foreach ($instalacion->get_lista_bases() as $db) {
         $param = $instalacion->get_parametros_base($db);
         $store->append(array($db));
     }
     $this->comp['combo_base']->set_model($store);
     $cellRenderer = new GtkCellRendererText();
     $this->comp['combo_base']->pack_start($cellRenderer);
     $this->comp['combo_base']->set_active(0);
     //--- Pone los proyectos
     $proyectos = toba_modelo_proyecto::get_lista();
     foreach ($proyectos as $path => $id) {
         $label = $path == $id ? $id : "{$id} (Directorio {$path})";
         $check = new GtkCheckButton($label);
         $check->set_use_underline(false);
         $this->check_proyectos[] = array($id, $path, $check);
         $check->show();
         $this->comp['box_proyectos']->pack_start($check);
     }
 }
Beispiel #2
0
 function construir_dialogo($id_proyecto = null)
 {
     $archivo = dirname(__FILE__) . '/toba.glade';
     $glade = new GladeXML($archivo, 'vbox');
     foreach (self::$comp_req as $comp) {
         $this->comp[$comp] = $glade->get_widget($comp);
     }
     $glade->signal_autoconnect_instance($this);
     //--- Arbol
     $columna = new GtkTreeViewColumn('Comandos');
     $renderer = new GtkCellRendererPixbuf();
     $columna->pack_start($renderer, false);
     $columna->set_attributes($renderer, 'pixbuf', 1);
     $renderer = new GtkCellRendererText();
     $columna->pack_start($renderer, true);
     $columna->set_attributes($renderer, 'text', 0);
     $this->comp['arbol_comandos']->append_column($columna);
     $seleccionado = $this->cargar_comandos($id_proyecto);
     $selection = $this->comp['arbol_comandos']->get_selection();
     $selection->set_mode(Gtk::SELECTION_SINGLE);
     $selection->connect('changed', array($this, 'evt__seleccionar_comando'));
     if (isset($seleccionado)) {
         $selection->select_iter($seleccionado);
     }
     //$this->connect('button-release-event', array($this, 'evt__popup'));
     return $this->comp['vbox'];
 }
 function __construct($toba_instalador)
 {
     $this->toba_instalador = $toba_instalador;
     $archivo = dirname(__FILE__) . '/toba.glade';
     $glade = new GladeXML($archivo, 'dlg_importar_proyecto');
     foreach (self::$comp_req as $comp) {
         $this->comp[$comp] = $glade->get_widget($comp);
     }
     $glade->signal_autoconnect_instance($this);
 }
 function __construct($toba_instalador)
 {
     $this->toba_instalador = $toba_instalador;
     $archivo = dirname(__FILE__) . '/toba.glade';
     $glade = new GladeXML($archivo, 'dlg_crear_usuario');
     foreach (self::$comp_req as $comp) {
         $this->comp[$comp] = $glade->get_widget($comp);
     }
     $glade->signal_autoconnect_instance($this);
     $pixbuf = $this->comp['dlg_crear_usuario']->render_icon(Gtk::STOCK_DIALOG_QUESTION, Gtk::ICON_SIZE_DIALOG);
     $this->comp['dlg_crear_usuario']->set_icon($pixbuf);
 }
Beispiel #5
0
function showAboutDialog()
{
    global $dialogAbout, $appVer;
    $dialogAbout = new GladeXML('resources/dialogAbout.glade');
    $_dialogAbout = $dialogAbout->get_widget('_dialogAbout');
    $_dialogAbout->connect('activate-link', 'openURLHook');
    $_dialogAbout->connect_simple('response', 'closeAboutDialog');
    $_dialogAbout->set_version($appVer);
    $_aboutDescription = $_dialogAbout->get_children()[0]->get_children()[0]->get_children()[2];
    $_aboutDescription->set_use_markup(true);
    $_aboutDescription->connect('activate-link', 'openURLHook');
}
 function __construct($toba_instalador, $param_comando)
 {
     $this->param_comando = $param_comando;
     $this->toba_instalador = $toba_instalador;
     $archivo = dirname(__FILE__) . '/toba.glade';
     $glade = new GladeXML($archivo, 'dlg_importar_instancia');
     foreach (self::$comp_req as $comp) {
         $this->comp[$comp] = $glade->get_widget($comp);
     }
     $glade->signal_autoconnect_instance($this);
     $this->comp['edit_toba']->set_text(toba_dir());
     $this->evt__cambio_directorio();
 }
 private function loadGlade($file)
 {
     $glade = file_get_contents($file);
     $glade = \GladeXML::new_from_buffer($glade);
     //$glade = new \GladeXML($file);
     $glade->signal_autoconnect_instance($this);
     $this->glade = $glade;
 }
Beispiel #8
0
function showOpenDialog()
{
    global $dialogOpen, $fileList;
    $dialogOpen = new GladeXML('resources/dialogOpen.glade');
    $_fileChooser = $dialogOpen->get_widget('_fileChooser');
    $_btnOpen = $dialogOpen->get_widget('_btnOpen');
    $_btnCancel = $dialogOpen->get_widget('_btnCancel');
    $_btnOpen->connect_simple('clicked', 'openDialogChooseFile');
    $_fileChooser->connect_simple('file-activated', 'openDialogChooseFile');
    $_fileChooser->connect_simple('selection-changed', 'openDialogCheckFile');
    $_btnCancel->connect_simple('clicked', 'openDialogCancel');
    gtIcon($_btnOpen, Gtk::STOCK_OPEN);
    gtIcon($_btnCancel, Gtk::STOCK_CANCEL);
    gtFileFilter($_fileChooser, '*.svg', _('SVG files'));
    gtFileFilter($_fileChooser, '*', _('All files'));
    if (isset($fileList['directory'])) {
        $_fileChooser->select_uri($fileList['currentFile']);
    }
}
 function __construct($toba_instalador, $param_comando)
 {
     $this->param_comando = $param_comando;
     $this->toba_instalador = $toba_instalador;
     $archivo = dirname(__FILE__) . '/toba.glade';
     $glade = new GladeXML($archivo, 'dlg_cargar_proyecto');
     foreach (self::$comp_req as $comp) {
         $this->comp[$comp] = $glade->get_widget($comp);
     }
     $glade->signal_autoconnect_instance($this);
     $modelo = new GtkListStore(Gtk::TYPE_STRING, Gtk::TYPE_STRING);
     $opciones = toba_modelo_proyecto::get_lista();
     print_r($opciones);
     $iter = $modelo->append(array($this->label_otro, null));
     foreach ($opciones as $path => $id) {
         $label = $id == $path ? $id : "{$id} ({$path})";
         $modelo->append(array($label, $id));
     }
     $this->comp['combo_proyecto']->set_model($modelo);
     $this->comp['combo_proyecto']->set_active_iter($iter);
     $this->evt__cambio_proyecto();
 }
 function __construct($toba_instalador)
 {
     $this->toba_instalador = $toba_instalador;
     $archivo = dirname(__FILE__) . '/toba.glade';
     $glade = new GladeXML($archivo, 'dlg_registrar_base');
     foreach (self::$comp_req as $comp) {
         $this->comp[$comp] = $glade->get_widget($comp);
     }
     $glade->signal_autoconnect_instance($this);
     $pixbuf = $this->comp['dlg_registrar_base']->render_icon(Gtk::STOCK_DIALOG_QUESTION, Gtk::ICON_SIZE_DIALOG);
     $this->comp['dlg_registrar_base']->set_icon($pixbuf);
     $modelo = new GtkListStore(Gtk::TYPE_STRING);
     foreach ($this->toba_instalador->get_instalacion()->get_lista_instancias() as $id_instancia) {
         $iter = $modelo->append(array($id_instancia));
     }
     $this->comp['combo_instancia']->set_model($modelo);
     $modelo = new GtkListStore(Gtk::TYPE_STRING);
     foreach ($this->toba_instalador->get_instalacion()->get_lista_bases() as $id_base) {
         $iter = $modelo->append(array($id_base));
     }
     $this->comp['combo_reutilizar']->set_model($modelo);
     $this->evt__cambiar_tipo();
     $this->evt__tomar_definicion();
 }
Beispiel #11
0
function showPreferencesDialog()
{
    global $dialogPreferences, $config, $radioGroup, $i18n, $langList, $gui;
    $dialogPreferences = new GladeXML(gtTranslateGlade('dialogPreferences'));
    $_btnSave = $dialogPreferences->get_widget('_btnSave');
    $_btnCancel = $dialogPreferences->get_widget('_btnCancel');
    $_btnRecognizeInkscape = $dialogPreferences->get_widget('_btnRecognizeInkscape');
    $_noticeLabel = $dialogPreferences->get_widget('_noticeLabel');
    $_prefDisplayPreview = $dialogPreferences->get_widget('_prefDisplayPreview');
    $_prefLanguageSelect = $dialogPreferences->get_widget('_prefLanguageSelect');
    $_prefUploadEnable = $dialogPreferences->get_widget('_prefUploadEnable');
    $_prefUploadTable = $dialogPreferences->get_widget('_prefUploadTable');
    $_prefInkscapePath = $dialogPreferences->get_widget('_prefInkscapePath');
    $_btnCancel->connect_simple('clicked', 'cancelPreferencesDialog');
    $_btnSave->connect_simple('clicked', 'savePreferencesDialog');
    $_btnRecognizeInkscape->connect_simple('clicked', 'recognizeInkscape');
    $_prefDisplayPreview->connect('toggled', 'setDisplayPreview');
    $_prefUploadEnable->connect_simple('toggled', 'gtToggler', $_prefUploadEnable, $_prefUploadTable);
    $dialogPreferences->get_widget('_prefUploadGetKey')->connect_simple('clicked', 'openURL', 'https://openclipart.org/manage/profile');
    gtIcon($_btnSave, Gtk::STOCK_SAVE);
    gtIcon($_btnCancel, Gtk::STOCK_CANCEL);
    gtIcon($_btnRecognizeInkscape, Gtk::STOCK_FIND);
    gtColor($_noticeLabel, 'fg', $gui['CNoticeBarFG']);
    gtFont($_noticeLabel, $gui['SNoticeBar']);
    gtFont($dialogPreferences->get_widget('_prefUploadGetKeyLBottom'), $gui['XSmallNote']);
    gtFont($dialogPreferences->get_widget('_prefUploadAPIWarn'), $gui['XSmallNote']);
    // Setting states/strings basing on config variable
    if ($config['firstTime']) {
        setPreferencesNoticeBox($i18n->_('prefNoticeFirstTime'));
    }
    // First time, autorun of preferences dialog
    $dialogPreferences->get_widget('_prefDisplayInfobar')->set_active($config['displayInfobar']);
    $dialogPreferences->get_widget('_prefDisplayNavbar')->set_active($config['displayNavbar']);
    $_prefDisplayPreview->set_active($config['displayPreview']);
    $dialogPreferences->get_widget('_prefPreviewAreaBox')->set_sensitive($config['displayPreview']);
    $dialogPreferences->get_widget($radioGroup['toolbarStyle'][$config['toolbarStyle']])->set_active(true);
    $dialogPreferences->get_widget($radioGroup['previewArea'][$config['previewArea']])->set_active(true);
    $_prefUploadEnable->set_active($config['enableUpload']);
    $dialogPreferences->get_widget('_prefUploadNSFW')->set_active($config['NSFWTagToFlag']);
    $_prefUploadTable->set_sensitive($config['enableUpload']);
    gtSetText($dialogPreferences->get_widget('_prefUploadUsername'), $config['uploadUsername']);
    gtSetText($dialogPreferences->get_widget('_prefUploadAPIKey'), $config['uploadAPIKey']);
    $dialogPreferences->get_widget('_prefTempPath')->select_uri($config['tempDirectory']);
    if ($config['inkscapePath']) {
        $_prefInkscapePath->select_uri($config['inkscapePath']);
    } else {
        $_prefInkscapePath->unselect_all();
    }
    // setting language combobox
    $comboIndex = 0;
    foreach ($langList as $code => $name) {
        $comboStr = "{$name} ({$code})";
        $_prefLanguageSelect->append_text($comboStr);
        if ($config['language'] === $code) {
            $_prefLanguageSelect->set_active($comboIndex);
        }
        $comboIndex++;
    }
    // signals that displays infobar notices; they have to be set after widget setup
    $_prefDisplayPreview->connect('toggled', 'setDisplayPreview');
    $dialogPreferences->get_widget('_prefPreviewPage')->connect_simple('toggled', 'setPreferencesNoticeBox', $i18n->_('prefNoticeRefresh'));
    $dialogPreferences->get_widget('_prefPreviewDrawing')->connect_simple('toggled', 'setPreferencesNoticeBox', $i18n->_('prefNoticeDrawingArea') . "\n" . $i18n->_('prefNoticeRefresh'), $gui['CNoticeBarWarnBG']);
    if (detectOS(HK_OS_WINDOWS)) {
        $_prefInkscapePath->connect_simple('file-set', 'checkInkscapePath');
    }
}
Beispiel #12
0
<?php

$ui = new GladeXML('journalgui.glade');
$window = $ui->get_widget("window1");
$window->show_all();
gtk::main();
Beispiel #13
0
require_once 'core/guiOptions.php';
require_once 'core/Krzysiui18n.class.php';
require_once 'core/gtkToolbox.php';
require_once 'core/config.php';
require_once 'Gtk2/FileDrop.php';
require_once 'core/svgReadMeta.php';
require_once 'core/gladeTranslate.php';
require_once 'i18n/langList.php';
// If Windows user forced run without VC++, yet somehow app runs, .firstrun file may be deleted,
// so the .exe loader won't bug for VC++ install anymore
if (detectOS(HK_OS_WINDOWS) && file_exists('.firstrun')) {
    unlink('.firstrun');
}
$i18n = new Krzysiui18n('i18n');
$i18n->setLang($config['language'], 'en_US');
$glade = new GladeXML('resources/mainWindow.glade');
/* Preparing tip of the day */
$tips = [];
$tips['tips'] = explode('|', $i18n->_('TOTD'));
$tips['current'] = array_rand($tips['tips']);
/* Getting widgets */
$_mainWindow = $glade->get_widget('_mainWindow');
$_btnCopy = $glade->get_widget('_btnCopy');
$_topLabel = $glade->get_widget('_topLabel');
$_tipLabel = $glade->get_widget('_tipLabel');
$_eventBox = $glade->get_widget('_eventBox');
$_topIcon = $glade->get_widget('_topIcon');
$_btnOpen = $glade->get_widget('_btnOpen');
$_btnAbout = $glade->get_widget('_btnAbout');
$_btnUpload = $glade->get_widget('_btnUpload');
$_btnConfig = $glade->get_widget('_btnConfig');