public function __construct() { parent::__construct(); $dbi = new DBInterface(); $this->strings = KioskClient::getStrings(); $this->set_position(Gtk::WIN_POS_CENTER); $this->set_default_size(300, 200); $this->set_resizable(false); $this->timeLabel = new GtkLabel($this->strings["timeLeftLabel_begin"] . '0' . $this->strings["timeLeftLabel_end"]); $this->set_title($this->strings["windowTitle_begin"] . '0' . $this->strings["windowTitle_end"]); $this->logoutButton = new GtkButton($this->strings['logoutButton']); $this->pauseButton = new GtkButton($this->strings['pauseButton']); $box = new GtkVBox(); $box->pack_start($this->timeLabel); if ($dbi->getSetting('max_pause_time')) { $box->pack_start($this->pauseButton); } $box->pack_start($this->logoutButton); # if ( DEBUG ) { # $this->quitButton = new GtkButton("Quit"); # $box->pack_start( $this->quitButton ); # } # $this->connect_simple( 'destroy', array('Gtk', 'main_quit') ); $this->add($box); }
public function __construct() { parent::__construct(); $this->strings = KioskClient::getStrings(); $this->set_default_size(200, 100); $this->set_resizable(false); $this->set_modal(true); $label = new GtkLabel($this->strings["logoutWarningLabel"]); $this->vbox->pack_start($label); $this->vbox->show_all(); $this->add_button(Gtk::STOCK_NO, Gtk::RESPONSE_NO); $this->add_button(GtK::STOCK_YES, Gtk::RESPONSE_YES); }
public function __construct($message) { parent::__construct(); $this->strings = KioskClient::getStrings(); $this->set_default_size(300, 200); $this->set_resizable(false); $this->set_keep_above(true); $this->set_title("Message: {$message}"); $this->messageLabel = new GtkLabel(); $this->messageLabel->set_use_markup(true); $this->messageLabel->set_markup($this->strings["message_begin"] . $message . $this->strings["message_end"]); $this->set_title($message); $hbox = new GtkHBox(); $stock = GtkImage::new_from_stock(Gtk::STOCK_DIALOG_WARNING, Gtk::ICON_SIZE_DIALOG); $hbox->pack_start($stock, 0, 0); $hbox->pack_start($this->messageLabel); $this->add($hbox); $this->show_all(); }
public function __construct($username) { parent::__construct(); $this->username = $username; $this->strings = KioskClient::getStrings(); # $this->set_default_size( 300, 200 ); $this->set_resizable(false); $this->set_modal(true); $this->set_keep_above(true); $this->set_title($this->strings['setPassword']); $this->messageLabel = new GtkLabel(); $this->messageLabel->set_use_markup(true); $this->messageLabel->set_markup($this->strings['setPassword']); $passwordLabel1 = new GtkLabel(); $passwordLabel1->set_use_markup(true); $passwordLabel1->set_label($this->strings['passwordLabel']); $this->passwordEntry1 = new GtkEntry(); $this->passwordEntry1->set_visibility(0); $passwordBox1 = new GtkHBox(); $passwordBox1->pack_start($passwordLabel1); $passwordBox1->pack_start($this->passwordEntry1); $passwordLabel2 = new GtkLabel(); $passwordLabel2->set_use_markup(true); $passwordLabel2->set_label($this->strings['passwordLabel']); $this->passwordEntry2 = new GtkEntry(); $this->passwordEntry2->set_visibility(0); $passwordBox2 = new GtkHBox(); $passwordBox2->pack_start($passwordLabel2); $passwordBox2->pack_start($this->passwordEntry2); $this->setPasswordButton = new GtkButton($this->strings['setPasswordButton']); $mainBox = new GtkVBox(); $mainBox->pack_start($this->messageLabel); $mainBox->pack_start($passwordBox1); $mainBox->pack_start($passwordBox2); $mainBox->pack_start($this->setPasswordButton); $this->add($mainBox); $this->connect('key-press-event', array(&$this, 'onKey'), $input); $this->setPasswordButton->connect_simple('clicked', array(&$this, 'onClick')); $this->show_all(); }
public function __construct($message) { parent::__construct(); $this->strings = KioskClient::getStrings(); $this->set_position(GtK::WIN_POS_CENTER_ALWAYS); $this->set_default_size(200, 100); $this->set_resizable(false); $this->set_modal(false); $alertMessage = new GtkLabel(); $alertMessage->set_use_markup(true); $alertMessage->set_markup($message); $this->vbox->pack_start($hbox = new GtkHBox()); $stock = GtkImage::new_from_stock(Gtk::STOCK_DIALOG_WARNING, Gtk::ICON_SIZE_DIALOG); $hbox->pack_start($stock, 0, 0); $hbox->pack_start($alertMessage); $this->add_button(Gtk::STOCK_OK, Gtk::RESPONSE_OK); $this->action_area->set_layout(Gtk::BUTTONBOX_SPREAD); $this->set_has_separator(false); $this->show_all(); $this->run(); $this->destroy(); }
public function __construct($status = null) { if (DEBUG) { echo "LoginWindow::__construct( \$status = {$status} )\n"; } parent::__construct(); $this->strings = KioskClient::getStrings(); $this->status = $status; $screen = GdkScreen::get_default(); $screenWidth = $screen->get_width(); $screenHeight = $screen->get_height(); $this->set_decorated(1); $this->set_default_size(800, 600); ##Temporary Changed for testing ($screenWidth, $screenHeight) #$this->fullscreen(); $this->set_keep_above(0); $this->set_modal(1); $messageBox = new GtkHBox(); $this->loginBox = new GtkVBox(); $this->errorBox = new GtkVBox(); $usernameBox = new GtkHBox(); $passwordBox = new GtkHBox(); ## Build the login box $this->messageLabel = new GtkLabel(); $this->messageLabel->set_use_markup(true); $this->messageLabel->set_label($this->strings['promptLabel']); $usernameLabel = new GtkLabel(); $usernameLabel->set_use_markup(true); $usernameLabel->set_label($this->strings['usernameLabel']); $this->usernameEntry = new GtkEntry(); $passwordLabel = new GtkLabel(); $passwordLabel->set_use_markup(true); $passwordLabel->set_label($this->strings['passwordLabel']); $this->passwordEntry = new GtkEntry(); $this->passwordEntry->set_visibility(0); $this->loginButton = new GtkButton($this->strings['loginButton']); $messageBox->pack_start($this->messageLabel); $usernameBox->pack_start($usernameLabel); $usernameBox->pack_start($this->usernameEntry); $passwordBox->pack_start($passwordLabel); $passwordBox->pack_start($this->passwordEntry); $this->loginBox->pack_start($messageBox); $this->loginBox->pack_start($usernameBox); $this->loginBox->pack_start($passwordBox); $this->loginBox->pack_start($this->loginButton); ## Build the error message box $this->errorLabel = new GtkLabel(); $this->errorLabel->set_use_markup(true); $this->errorLabel->set_label('Error : Username and Password Do Not Match'); $errorLabelBox = new GtkHBox(); $errorLabelBox->pack_start($this->errorLabel); $this->errorButton = new GtkButton('OK'); $errorButtonBox = new GtkHBox(); $errorButtonBox->pack_start($this->errorButton); $this->errorBox->pack_start($errorLabelBox); $this->errorBox->pack_start($errorButtonBox); if (DEBUG) { $this->quitButton = new GtkButton("Quit"); $this->loginBox->pack_start($this->quitButton); } $this->connect_simple('destroy', array('Gtk', 'main_quit')); $centerHBox = new GtkHBox(); $centerVBox = new GtkVBox(); $leftBox = new GtkHBox(); $rightBox = new GtkHBox(); $topBox = new GtkHBox(); $bottomBox = new GtkHBox(); $insideTopBox = new GtkVBox(); $this->topLabel = new GtkLabel(); $this->topLabel->set_use_markup(true); $this->topLabel->set_label($this->strings['topLabel']); $insideTopBox->pack_start($this->topLabel); if (file_exists('/etc/libki/logo.png')) { $logo = GtkImage::new_from_file('/etc/libki/logo.png'); $insideTopBox->pack_start($logo); } elseif (file_exists('logo.png')) { $logo = GtkImage::new_from_file('logo.png'); $insideTopBox->pack_start($logo); } $topBox->pack_start($insideTopBox); $centerHBox->pack_start($leftBox, true); $centerHBox->pack_start($this->loginBox, false); $centerHBox->pack_start($this->errorBox, false); $centerHBox->pack_start($rightBox, true); $centerVBox->pack_start($topBox, true); $centerVBox->pack_start($centerHBox, false); $centerVBox->pack_start($bottomBox, true); $this->add($centerVBox); }