Exemplo n.º 1
0
static void 
gw_application_activate (GApplication *application)
{
    GwApplicationPrivate *priv;
    GwSearchWindow *searchwindow;
    GwVocabularyWindow *vocabularywindow;
    GwSettingsWindow *settingswindow;
    GwDictionaryList *dictionarylist;

    priv = GW_APPLICATION (application)->priv;
    dictionarylist = gw_application_get_installed_dictionarylist (GW_APPLICATION (application));

    if (priv->arg_new_vocabulary_window_switch)
    {
      vocabularywindow = GW_VOCABULARYWINDOW (gw_vocabularywindow_new (GTK_APPLICATION (application)));
      gtk_widget_show (GTK_WIDGET (vocabularywindow));
      return;
    }

    else
    {
      searchwindow = GW_SEARCHWINDOW (gw_searchwindow_new (GTK_APPLICATION (application)));
      gtk_widget_show (GTK_WIDGET (searchwindow));

      if (lw_dictionarylist_get_total (LW_DICTIONARYLIST (dictionarylist)) == 0)
      {
        settingswindow = GW_SETTINGSWINDOW (gw_settingswindow_new (GTK_APPLICATION (application)));
        gtk_window_set_transient_for (GTK_WINDOW (settingswindow), GTK_WINDOW (searchwindow));
        gtk_widget_show (GTK_WIDGET (settingswindow));
      }
      return;
    }
}
Exemplo n.º 2
0
G_MODULE_EXPORT void 
gw_application_open_searchwindow_cb (GSimpleAction *action, 
                                     GVariant      *parameter, 
                                     gpointer       data)
{
    //Declarations
    GwApplication *application;
    GtkWindow *window;

    //Initializations
    application = GW_APPLICATION (data);
    g_return_if_fail (application != NULL);
    window = gw_searchwindow_new (GTK_APPLICATION (application));

    gtk_widget_show (GTK_WIDGET (window));
}