2016-10-04 15:42:36 +05:00
// URTator - Urban Terror server browser and game launcher, written in
// Go.
//
// Copyright (c) 2016, Stanslav N. a.k.a pztrn (or p0z1tr0n)
// All rights reserved.
//
// Licensed under Terms and Conditions of GNU General Public License
// version 3 or any higher.
// ToDo: put full text of license here.
package ui
import (
// stdlib
"fmt"
2016-11-22 01:10:31 +05:00
"runtime"
2016-10-04 15:42:36 +05:00
// Local
"github.com/pztrn/urtrator/datamodels"
// Other
"github.com/mattn/go-gtk/gtk"
"github.com/mattn/go-gtk/glib"
)
type OptionsDialog struct {
// Window.
window * gtk . Window
// Options main VBox.
vbox * gtk . VBox
// Tabs widget.
tab_widget * gtk . Notebook
// Widgets.
// General tab.
// Show tray icon checkbutton.
show_tray_icon * gtk . CheckButton
// Enable autoupdate checkbutton.
autoupdate * gtk . CheckButton
2017-02-09 02:31:24 +05:00
// Appearance tab.
// Language to use.
language_combo * gtk . ComboBoxText
2016-10-04 15:42:36 +05:00
// Urban Terror tab.
// Profiles list.
profiles_list * gtk . TreeView
2016-12-13 08:01:48 +05:00
// Servers updating tab.
// Master server address.
master_server_addr * gtk . Entry
// Servers autoupdate.
servers_autoupdate * gtk . CheckButton
// Timeout for servers autoupdating.
servers_autoupdate_timeout * gtk . Entry
2016-10-04 15:42:36 +05:00
// Data stores.
// Urban Terror profiles list.
profiles_list_store * gtk . ListStore
}
func ( o * OptionsDialog ) addProfile ( ) {
fmt . Println ( "Adding profile..." )
op := OptionsProfile { }
2016-10-08 19:57:33 +05:00
op . Initialize ( false )
ctx . Eventer . LaunchEvent ( "flushProfiles" , map [ string ] string { } )
ctx . Eventer . LaunchEvent ( "loadProfilesIntoOptionsWindow" , map [ string ] string { } )
ctx . Eventer . LaunchEvent ( "loadProfilesIntoMainWindow" , map [ string ] string { } )
2016-10-04 15:42:36 +05:00
}
func ( o * OptionsDialog ) closeOptionsDialogByCancel ( ) {
o . window . Destroy ( )
}
func ( o * OptionsDialog ) closeOptionsDialogWithDiscard ( ) {
}
func ( o * OptionsDialog ) closeOptionsDialogWithSaving ( ) {
fmt . Println ( "Saving changes to options..." )
2016-10-05 01:03:46 +05:00
o . saveGeneral ( )
2017-02-09 02:31:24 +05:00
o . saveAppearance ( )
2016-10-05 01:03:46 +05:00
2016-11-22 01:10:31 +05:00
// Temporary disable all these modals on Linux.
// See https://github.com/mattn/go-gtk/issues/289.
if runtime . GOOS != "linux" {
2017-02-09 01:16:51 +05:00
mbox_string := ctx . Translator . Translate ( "Some options require application restart to be applied." , nil )
2016-11-22 01:10:31 +05:00
m := gtk . NewMessageDialog ( o . window , gtk . DIALOG_MODAL , gtk . MESSAGE_INFO , gtk . BUTTONS_OK , mbox_string )
m . Response ( func ( ) {
m . Destroy ( )
} )
m . Run ( )
}
2016-10-05 01:03:46 +05:00
2016-10-04 15:42:36 +05:00
o . window . Destroy ( )
}
func ( o * OptionsDialog ) deleteProfile ( ) {
// Oh... dat... GTK...
sel := o . profiles_list . GetSelection ( )
model := o . profiles_list . GetModel ( )
iter := new ( gtk . TreeIter )
_ = sel . GetSelected ( iter )
var p string
gval := glib . ValueFromNative ( p )
model . GetValue ( iter , 0 , gval )
profile_name := gval . GetString ( )
if len ( profile_name ) > 0 {
fmt . Println ( "Deleting profile '" + profile_name + "'" )
profile := datamodels . Profile { }
profile . Name = profile_name
2016-10-08 19:57:33 +05:00
ctx . Eventer . LaunchEvent ( "deleteProfile" , map [ string ] string { "profile_name" : profile_name } )
ctx . Eventer . LaunchEvent ( "flushProfiles" , map [ string ] string { } )
ctx . Eventer . LaunchEvent ( "loadProfilesIntoMainWindow" , map [ string ] string { } )
ctx . Eventer . LaunchEvent ( "loadProfilesIntoOptionsWindow" , map [ string ] string { } )
2016-10-04 15:42:36 +05:00
}
}
func ( o * OptionsDialog ) editProfile ( ) {
// Oh... dat... GTK...
sel := o . profiles_list . GetSelection ( )
model := o . profiles_list . GetModel ( )
iter := new ( gtk . TreeIter )
_ = sel . GetSelected ( iter )
var p string
gval := glib . ValueFromNative ( p )
model . GetValue ( iter , 0 , gval )
profile_name := gval . GetString ( )
if len ( profile_name ) > 0 {
op := OptionsProfile { }
2016-10-08 19:57:33 +05:00
op . InitializeUpdate ( profile_name )
ctx . Eventer . LaunchEvent ( "flushProfiles" , map [ string ] string { } )
ctx . Eventer . LaunchEvent ( "loadProfilesIntoMainWindow" , map [ string ] string { } )
ctx . Eventer . LaunchEvent ( "loadProfilesIntoOptionsWindow" , map [ string ] string { } )
2016-10-04 15:42:36 +05:00
}
}
2016-10-05 01:03:46 +05:00
func ( o * OptionsDialog ) fill ( ) {
if ctx . Cfg . Cfg [ "/general/show_tray_icon" ] == "1" {
o . show_tray_icon . SetActive ( true )
}
if ctx . Cfg . Cfg [ "/general/urtrator_autoupdate" ] == "1" {
o . autoupdate . SetActive ( true )
}
2016-12-13 08:01:48 +05:00
// Servers updating tab.
master_server_addr , ok := ctx . Cfg . Cfg [ "/servers_updating/master_server" ]
if ! ok {
o . master_server_addr . SetText ( "master.urbanterror.info:27900" )
} else {
o . master_server_addr . SetText ( master_server_addr )
}
servers_autoupdate , ok1 := ctx . Cfg . Cfg [ "/servers_updating/servers_autoupdate" ]
if ok1 {
if servers_autoupdate == "1" {
o . servers_autoupdate . SetActive ( true )
}
}
servers_update_timeout , ok2 := ctx . Cfg . Cfg [ "/servers_updating/servers_autoupdate_timeout" ]
if ! ok2 {
o . servers_autoupdate_timeout . SetText ( "10" )
} else {
o . servers_autoupdate_timeout . SetText ( servers_update_timeout )
}
2016-10-05 01:03:46 +05:00
}
2016-10-10 19:22:21 +05:00
// Appearance tab initialization.
func ( o * OptionsDialog ) initializeAppearanceTab ( ) {
appearance_vbox := gtk . NewVBox ( false , 0 )
2017-02-09 02:31:24 +05:00
appearance_table := gtk . NewTable ( 1 , 2 , false )
2016-10-10 19:22:21 +05:00
2017-02-09 02:31:24 +05:00
language_selection_tooltip := ctx . Translator . Translate ( "Language which URTrator will use.\n\nChanging this requires URTrator restart!" , nil )
language_selection_label := gtk . NewLabel ( ctx . Translator . Translate ( "Language:" , nil ) )
language_selection_label . SetAlignment ( 0 , 0 )
language_selection_label . SetTooltipText ( language_selection_tooltip )
appearance_table . Attach ( language_selection_label , 0 , 1 , 0 , 1 , gtk . FILL , gtk . SHRINK , 5 , 5 )
o . language_combo = gtk . NewComboBoxText ( )
o . language_combo . SetTooltipText ( language_selection_tooltip )
// Get all available languages and fill combobox.
lang_idx := 0
var lang_active int = 0
for lang , _ := range ctx . Translator . AcceptedLanguages {
o . language_combo . AppendText ( lang )
if ctx . Translator . AcceptedLanguages [ lang ] == ctx . Cfg . Cfg [ "/general/language" ] {
lang_active = lang_idx
}
lang_idx += 1
}
o . language_combo . SetActive ( lang_active )
2017-05-08 23:38:54 +05:00
appearance_table . Attach ( o . language_combo , 1 , 2 , 0 , 1 , gtk . FILL | gtk . EXPAND , gtk . FILL , 5 , 5 )
2017-02-09 02:31:24 +05:00
appearance_vbox . PackStart ( appearance_table , false , true , 0 )
2017-02-09 01:16:51 +05:00
o . tab_widget . AppendPage ( appearance_vbox , gtk . NewLabel ( ctx . Translator . Translate ( "Appearance" , nil ) ) )
2016-10-10 19:22:21 +05:00
}
2016-10-04 15:42:36 +05:00
func ( o * OptionsDialog ) initializeGeneralTab ( ) {
general_vbox := gtk . NewVBox ( false , 0 )
2016-11-25 04:31:45 +05:00
general_table := gtk . NewTable ( 2 , 2 , false )
2016-10-04 15:42:36 +05:00
// Tray icon checkbox.
2017-02-09 01:16:51 +05:00
show_tray_icon_label := gtk . NewLabel ( ctx . Translator . Translate ( "Show icon in tray" , nil ) )
2016-11-25 04:31:45 +05:00
show_tray_icon_label . SetAlignment ( 0 , 0 )
general_table . Attach ( show_tray_icon_label , 0 , 1 , 0 , 1 , gtk . FILL , gtk . SHRINK , 5 , 5 )
o . show_tray_icon = gtk . NewCheckButtonWithLabel ( "" )
2017-02-09 01:16:51 +05:00
o . show_tray_icon . SetTooltipText ( ctx . Translator . Translate ( "Show icon in tray" , nil ) )
2017-05-08 23:38:54 +05:00
general_table . Attach ( o . show_tray_icon , 1 , 2 , 0 , 1 , gtk . FILL | gtk . EXPAND , gtk . FILL , 5 , 5 )
2016-10-04 15:42:36 +05:00
// Autoupdate checkbox.
2017-02-09 01:16:51 +05:00
autoupdate_tooltip := ctx . Translator . Translate ( "Should URTrator check for updates and update itself? Not working now." , nil )
autoupdate_label := gtk . NewLabel ( ctx . Translator . Translate ( "Automatically update URTrator?" , nil ) )
2016-11-25 04:31:45 +05:00
autoupdate_label . SetTooltipText ( autoupdate_tooltip )
autoupdate_label . SetAlignment ( 0 , 0 )
general_table . Attach ( autoupdate_label , 0 , 1 , 1 , 2 , gtk . FILL , gtk . SHRINK , 5 , 5 )
o . autoupdate = gtk . NewCheckButtonWithLabel ( "" )
o . autoupdate . SetTooltipText ( autoupdate_tooltip )
2017-05-08 23:38:54 +05:00
general_table . Attach ( o . autoupdate , 1 , 2 , 1 , 2 , gtk . FILL | gtk . EXPAND , gtk . FILL , 5 , 5 )
2016-11-25 04:31:45 +05:00
// Vertical separator.
sep := gtk . NewVBox ( false , 0 )
general_vbox . PackStart ( general_table , false , true , 0 )
general_vbox . PackStart ( sep , false , true , 0 )
2016-10-04 15:42:36 +05:00
2017-02-09 01:16:51 +05:00
o . tab_widget . AppendPage ( general_vbox , gtk . NewLabel ( ctx . Translator . Translate ( "General" , nil ) ) )
2016-10-04 15:42:36 +05:00
}
2016-12-13 08:01:48 +05:00
func ( o * OptionsDialog ) initializeServersOptionsTab ( ) {
servers_options_vbox := gtk . NewVBox ( false , 0 )
servers_updating_table := gtk . NewTable ( 3 , 2 , false )
servers_updating_table . SetRowSpacings ( 2 )
// Master server address.
2017-02-09 01:16:51 +05:00
master_server_addr_tooltip := ctx . Translator . Translate ( "Address of master server. Specify in form: addr:port." , nil )
master_server_addr_label := gtk . NewLabel ( ctx . Translator . Translate ( "Master server address" , nil ) )
2016-12-13 08:01:48 +05:00
master_server_addr_label . SetTooltipText ( master_server_addr_tooltip )
master_server_addr_label . SetAlignment ( 0 , 0 )
servers_updating_table . Attach ( master_server_addr_label , 0 , 1 , 0 , 1 , gtk . FILL , gtk . SHRINK , 5 , 5 )
o . master_server_addr = gtk . NewEntry ( )
o . master_server_addr . SetTooltipText ( master_server_addr_tooltip )
servers_updating_table . Attach ( o . master_server_addr , 1 , 2 , 0 , 1 , gtk . FILL , gtk . FILL , 5 , 5 )
// Servers autoupdate checkbox.
2017-02-09 01:16:51 +05:00
servers_autoupdate_cb_tooptip := ctx . Translator . Translate ( "Should servers be automatically updated?" , nil )
servers_autoupdate_cb_label := gtk . NewLabel ( ctx . Translator . Translate ( "Servers autoupdate" , nil ) )
2016-12-13 08:01:48 +05:00
servers_autoupdate_cb_label . SetTooltipText ( servers_autoupdate_cb_tooptip )
servers_autoupdate_cb_label . SetAlignment ( 0 , 0 )
servers_updating_table . Attach ( servers_autoupdate_cb_label , 0 , 1 , 1 , 2 , gtk . FILL , gtk . SHRINK , 5 , 5 )
o . servers_autoupdate = gtk . NewCheckButtonWithLabel ( "" )
o . servers_autoupdate . SetTooltipText ( servers_autoupdate_cb_tooptip )
2017-05-08 23:38:54 +05:00
servers_updating_table . Attach ( o . servers_autoupdate , 1 , 2 , 1 , 2 , gtk . EXPAND | gtk . FILL , gtk . FILL , 5 , 5 )
2016-12-13 08:01:48 +05:00
// Servers update timeout.
2017-02-09 01:16:51 +05:00
servers_autoupdate_timeout_tooltip := ctx . Translator . Translate ( "Timeout which will trigger servers information update, in minutes." , nil )
servers_autoupdate_label := gtk . NewLabel ( ctx . Translator . Translate ( "Servers update timeout (minutes)" , nil ) )
2016-12-13 08:01:48 +05:00
servers_autoupdate_label . SetTooltipText ( servers_autoupdate_timeout_tooltip )
servers_autoupdate_label . SetAlignment ( 0 , 0 )
servers_updating_table . Attach ( servers_autoupdate_label , 0 , 1 , 2 , 3 , gtk . FILL , gtk . SHRINK , 5 , 5 )
o . servers_autoupdate_timeout = gtk . NewEntry ( )
o . servers_autoupdate_timeout . SetTooltipText ( servers_autoupdate_timeout_tooltip )
servers_updating_table . Attach ( o . servers_autoupdate_timeout , 1 , 2 , 2 , 3 , gtk . FILL , gtk . FILL , 5 , 5 )
// Vertical separator.
sep := gtk . NewVBox ( false , 0 )
servers_options_vbox . PackStart ( servers_updating_table , false , true , 0 )
servers_options_vbox . PackStart ( sep , true , true , 0 )
2017-02-09 01:16:51 +05:00
o . tab_widget . AppendPage ( servers_options_vbox , gtk . NewLabel ( ctx . Translator . Translate ( "Servers updating" , nil ) ) )
2016-12-13 08:01:48 +05:00
}
2016-10-04 15:42:36 +05:00
func ( o * OptionsDialog ) initializeStorages ( ) {
// Structure:
// Name|Version|Second X session
o . profiles_list_store = gtk . NewListStore ( glib . G_TYPE_STRING , glib . G_TYPE_STRING , glib . G_TYPE_BOOL )
}
func ( o * OptionsDialog ) initializeTabs ( ) {
o . initializeStorages ( )
o . tab_widget = gtk . NewNotebook ( )
2016-10-10 19:22:21 +05:00
o . tab_widget . SetTabPos ( gtk . POS_LEFT )
2016-10-04 15:42:36 +05:00
o . initializeGeneralTab ( )
2016-10-10 19:22:21 +05:00
o . initializeAppearanceTab ( )
2016-10-04 15:42:36 +05:00
o . initializeUrtTab ( )
2016-12-13 08:01:48 +05:00
o . initializeServersOptionsTab ( )
2016-10-04 15:42:36 +05:00
// Buttons for saving and discarding changes.
buttons_hbox := gtk . NewHBox ( false , 0 )
2016-11-25 04:11:44 +05:00
sep := gtk . NewHBox ( false , 0 )
2016-10-04 15:42:36 +05:00
2017-02-09 01:16:51 +05:00
cancel_button := gtk . NewButtonWithLabel ( ctx . Translator . Translate ( "Cancel" , nil ) )
2016-10-04 15:42:36 +05:00
cancel_button . Clicked ( o . closeOptionsDialogByCancel )
2017-02-09 01:16:51 +05:00
ok_button := gtk . NewButtonWithLabel ( ctx . Translator . Translate ( "OK" , nil ) )
2016-10-04 15:42:36 +05:00
ok_button . Clicked ( o . closeOptionsDialogWithSaving )
buttons_hbox . PackStart ( sep , true , true , 5 )
buttons_hbox . PackStart ( cancel_button , false , true , 5 )
b uttons_hbox . PackStart ( ok_button , false , true , 5 )
o . vbox . PackStart ( o . tab_widget , true , true , 5 )
o . vbox . PackStart ( buttons_hbox , false , true , 5 )
2016-10-08 19:57:33 +05:00
ctx . Eventer . AddEventHandler ( "loadProfilesIntoOptionsWindow" , o . loadProfiles )
2016-10-04 15:42:36 +05:00
}
func ( o * OptionsDialog ) initializeUrtTab ( ) {
2016-11-25 04:31:45 +05:00
urt_hbox := gtk . NewHBox ( false , 5 )
2016-10-04 15:42:36 +05:00
// Profiles list.
o . profiles_list = gtk . NewTreeView ( )
2017-02-09 01:16:51 +05:00
o . profiles_list . SetTooltipText ( ctx . Translator . Translate ( "All available profiles" , nil ) )
2016-10-04 15:42:36 +05:00
urt_hbox . Add ( o . profiles_list )
o . profiles_list . SetModel ( o . profiles_list_store )
2017-02-09 01:16:51 +05:00
o . profiles_list . AppendColumn ( gtk . NewTreeViewColumnWithAttributes ( ctx . Translator . Translate ( "Profile name" , nil ) , gtk . NewCellRendererText ( ) , "text" , 0 ) )
o . profiles_list . AppendColumn ( gtk . NewTreeViewColumnWithAttributes ( ctx . Translator . Translate ( "Urban Terror version" , nil ) , gtk . NewCellRendererText ( ) , "text" , 1 ) )
2016-10-06 16:31:31 +05:00
2016-10-04 15:42:36 +05:00
// Profiles list buttons.
urt_profiles_buttons_vbox := gtk . NewVBox ( false , 0 )
2017-02-09 01:16:51 +05:00
button_add := gtk . NewButtonWithLabel ( ctx . Translator . Translate ( "Add" , nil ) )
button_add . SetTooltipText ( ctx . Translator . Translate ( "Add new profile" , nil ) )
2016-10-04 15:42:36 +05:00
button_add . Clicked ( o . addProfile )
2016-11-25 04:31:45 +05:00
urt_profiles_buttons_vbox . PackStart ( button_add , false , true , 0 )
2016-10-04 15:42:36 +05:00
2017-02-09 01:16:51 +05:00
button_edit := gtk . NewButtonWithLabel ( ctx . Translator . Translate ( "Edit" , nil ) )
button_edit . SetTooltipText ( ctx . Translator . Translate ( "Edit selected profile. Do nothing if no profile was selected." , nil ) )
2016-10-04 15:42:36 +05:00
button_edit . Clicked ( o . editProfile )
urt_profiles_buttons_vbox . PackStart ( button_edit , false , true , 5 )
// Spacer for profiles list buttons.
2016-11-25 04:11:44 +05:00
sep := gtk . NewVBox ( false , 0 )
2016-10-04 15:42:36 +05:00
urt_profiles_buttons_vbox . PackStart ( sep , true , true , 5 )
2017-02-09 01:16:51 +05:00
button_delete := gtk . NewButtonWithLabel ( ctx . Translator . Translate ( "Delete" , nil ) )
button_delete . SetTooltipText ( ctx . Translator . Translate ( "Delete selected profile. Do nothing if no profile was selected." , nil ) )
2016-10-04 15:42:36 +05:00
button_delete . Clicked ( o . deleteProfile )
2016-11-25 04:31:45 +05:00
urt_profiles_buttons_vbox . PackStart ( button_delete , false , true , 0 )
2016-10-04 15:42:36 +05:00
urt_hbox . Add ( urt_profiles_buttons_vbox )
2017-02-09 01:16:51 +05:00
o . tab_widget . AppendPage ( urt_hbox , gtk . NewLabel ( ctx . Translator . Translate ( "Urban Terror" , nil ) ) )
2016-10-04 15:42:36 +05:00
// Load Profiles.
2016-10-08 19:57:33 +05:00
ctx . Eventer . LaunchEvent ( "loadProfilesIntoOptionsWindow" , map [ string ] string { } )
2016-10-04 15:42:36 +05:00
}
2016-10-08 19:57:33 +05:00
func ( o * OptionsDialog ) loadProfiles ( data map [ string ] string ) {
2016-10-04 15:42:36 +05:00
fmt . Println ( "Loading profiles..." )
o . profiles_list_store . Clear ( )
2017-05-10 12:04:01 +05:00
ctx . Cache . ProfilesMutex . Lock ( )
2016-10-08 19:57:33 +05:00
for _ , p := range ctx . Cache . Profiles {
2016-10-04 15:42:36 +05:00
var iter gtk . TreeIter
o . profiles_list_store . Append ( & iter )
2016-10-08 19:57:33 +05:00
o . profiles_list_store . Set ( & iter , 0 , p . Profile . Name )
o . profiles_list_store . Set ( & iter , 1 , p . Profile . Version )
2016-10-04 15:42:36 +05:00
}
2017-05-10 12:04:01 +05:00
ctx . Cache . ProfilesMutex . Unlock ( )
2016-10-04 15:42:36 +05:00
}
2017-02-09 02:31:24 +05:00
func ( o * OptionsDialog ) saveAppearance ( ) {
ctx . Cfg . Cfg [ "/general/language" ] = ctx . Translator . AcceptedLanguages [ o . language_combo . GetActiveText ( ) ]
}
2016-10-05 01:03:46 +05:00
func ( o * OptionsDialog ) saveGeneral ( ) {
if o . show_tray_icon . GetActive ( ) {
ctx . Cfg . Cfg [ "/general/show_tray_icon" ] = "1"
} else {
ctx . Cfg . Cfg [ "/general/show_tray_icon" ] = "0"
}
if o . autoupdate . GetActive ( ) {
ctx . Cfg . Cfg [ "/general/urtrator_autoupdate" ] = "1"
} else {
ctx . Cfg . Cfg [ "/general/urtrator_autoupdate" ] = "0"
}
2016-12-13 08:01:48 +05:00
// Servers updating tab.
master_server_addr := o . master_server_addr . GetText ( )
if len ( master_server_addr ) < 1 {
ctx . Cfg . Cfg [ "/servers_updating/master_server" ] = "master.urbanterror.info:27900"
} else {
ctx . Cfg . Cfg [ "/servers_updating/master_server" ] = master_server_addr
}
if o . servers_autoupdate . GetActive ( ) {
ctx . Cfg . Cfg [ "/servers_updating/servers_autoupdate" ] = "1"
} else {
ctx . Cfg . Cfg [ "/servers_updating/servers_autoupdate" ] = "0"
}
update_timeout := o . servers_autoupdate_timeout . GetText ( )
if len ( update_timeout ) < 1 {
ctx . Cfg . Cfg [ "/servers_updating/servers_autoupdate_timeout" ] = "10"
} else {
ctx . Cfg . Cfg [ "/servers_updating/servers_autoupdate_timeout" ] = update_timeout
}
ctx . Eventer . LaunchEvent ( "initializeTasksForMainWindow" , map [ string ] string { } )
2016-10-05 01:03:46 +05:00
}
2016-10-04 15:42:36 +05:00
func ( o * OptionsDialog ) ShowOptionsDialog ( ) {
o . window = gtk . NewWindow ( gtk . WINDOW_TOPLEVEL )
2017-02-09 01:16:51 +05:00
o . window . SetTitle ( ctx . Translator . Translate ( "URTrator - Options" , nil ) )
2016-10-04 15:42:36 +05:00
o . window . Connect ( "destroy" , o . closeOptionsDialogWithDiscard )
o . window . SetModal ( true )
2017-05-08 23:38:54 +05:00
o . window . SetSizeRequest ( 750 , 600 )
2016-10-04 15:42:36 +05:00
o . window . SetPosition ( gtk . WIN_POS_CENTER )
o . window . SetIcon ( logo )
o . vbox = gtk . NewVBox ( false , 0 )
o . initializeTabs ( )
2016-10-05 01:03:46 +05:00
o . fill ( )
2016-10-04 15:42:36 +05:00
o . window . Add ( o . vbox )
2016-10-08 19:57:33 +05:00
ctx . Eventer . LaunchEvent ( "loadProfilesIntoOptionsWindow" , map [ string ] string { } )
2016-10-04 15:42:36 +05:00
o . window . ShowAll ( )
}