Browse Source

Add button to open the workspace directory to the settings window

handy-eval
Markus Koch 3 years ago
parent
commit
e4f711b310
  1. 13
      glade/mainWindow.glade
  2. 15
      src/mainwindow.c
  3. 1
      src/mainwindow.h

13
glade/mainWindow.glade

@ -640,6 +640,19 @@
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="buttonOpenWorkspaceFolder">
<property name="label" translatable="yes">Open Workspace in File Browser</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>

15
src/mainwindow.c

@ -527,6 +527,13 @@ static void mainWindow_settings_buttonCustomNewFileDateFormat_clicked(GtkComboBo
}
}
static void mainWindow_settings_buttonOpenWorkspaceFolder_clicked(GtkComboBox *widget, gpointer user_data)
{
struct mainWindow *mainWindow = (struct mainWindow *)user_data;
mainWindow_openExternalEditor(mainWindow->currentWorkspaceUrl);
}
const gchar *newDateFormats[] = {"%d.%m.%Y %H:%M",
"%Y-%m-%d %H:%M",
NULL};
@ -605,6 +612,11 @@ static void mainWindow_configure_settings_dialog(struct mainWindow *mainWindow)
(GCallback) mainWindow_settings_buttonCustomNewFileDateFormat_clicked,
mainWindow);
g_signal_connect(mainWindow->settingsDialog.buttonOpenWorkspaceFolder,
"clicked",
(GCallback) mainWindow_settings_buttonOpenWorkspaceFolder_clicked,
mainWindow);
g_signal_connect(mainWindow->settingsDialog.settingsDialog,
"delete-event",
(GCallback) mainWindow_settings_delete_event,
@ -664,6 +676,7 @@ struct mainWindow *mainWindow_new()
mainWindow->settingsDialog.stackNewDateFormat = GTK_WIDGET(gtk_builder_get_object(builder, "stackNewDateFormat"));
mainWindow->settingsDialog.entryNewDateFormat = GTK_WIDGET(gtk_builder_get_object(builder, "entryNewDateFormat"));
mainWindow->settingsDialog.buttonCustomNewFileDateFormat = GTK_WIDGET(gtk_builder_get_object(builder, "buttonCustomNewFileDateFormat"));
mainWindow->settingsDialog.buttonOpenWorkspaceFolder = GTK_WIDGET(gtk_builder_get_object(builder, "buttonOpenWorkspaceFolder"));
mainWindow->filterSettings.time_start = 0;
mainWindow->filterSettings.time_end = -1;
@ -711,6 +724,8 @@ void mainWindow_set_meta_information(struct mainWindow *mainWindow,
mainWindow->time_latest = time_latest;
mainWindow->filterSettings.hide_all = hide_all;
gtk_widget_set_sensitive(mainWindow->mainPane, !hide_all);
gtk_widget_set_sensitive(mainWindow->settingsDialog.buttonOpenWorkspaceFolder,
!hide_all);
mainWindow_clearSearch(NULL, mainWindow);
}

1
src/mainwindow.h

@ -93,6 +93,7 @@ struct mainWindow {
GtkWidget *stackNewDateFormat;
GtkWidget *comboNewDateFormat;
GtkWidget *buttonCustomNewFileDateFormat;
GtkWidget *buttonOpenWorkspaceFolder;
GtkWidget *entryNewDateFormat;
} settingsDialog;
};

Loading…
Cancel
Save